window.onload=function (){
var Post=document.getElementById("post");	
var oUl=document.getElementById("ul1");
var Comment=document.getElementById("comment");
var Li=document.getElementById("li1");

var myDate1=new Date();
var date1=myDate1.getFullYear()+"年"+(myDate1.getMonth()+1)+"月"+myDate1.getDate()+"日";
Li.innerHTML="路人甲:好吃!"+"<br>"+date1;

Post.onclick=function(){
	var myDate=new Date();
	var date=myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+myDate.getDate()+"日";
    var oLi=document.createElement("li");
	oLi.innerHTML="233";
	oUl.appendChild(oLi);
	if(Comment.value.length<5)
	{
	    alert("输入长度过短");
	}
	else
	{
	    var str="路人甲:"+Comment.value+"<br>"+date;
		var re=/草|妈/g;
		oLi.innerHTML=str.replace(re,"*");
	    Comment.value="";	
        oUl.appendChild(oLi);
	}	
};
};
    